#ifndef __AVLNODE_H__
#define __AVLNODE_H__

#include "StringKey.h"
#include "Worker.h"

class AvlNode
{
	AvlNode *m_lChild, *m_rChild, *m_parent;
	Worker* m_pData;
	StringKey* m_key;
	int m_balanced;	//balanced = R-L

public:

	void free();

	//Geters
	AvlNode* getLeftChild() {return m_lChild;}
	AvlNode* getRightChild() {return m_rChild;}
	AvlNode* getParent() {return m_parent;}
	StringKey* getKeyPtr() {return m_key;}
	Worker* getData() {return m_pData;}
	int getBalanced() {return m_balanced;}

	//Seters
	void setLeftChild(AvlNode* lChild) {m_lChild = lChild;}
	void setRightChild(AvlNode* rChild) {m_rChild = rChild;}
	void setParent(AvlNode* parent) {m_parent = parent;}
	void setData(Worker* wrokerP) {m_pData = wrokerP;}
	void setBalanced(int balanced) {m_balanced = balanced;}
	void setKeyPtr(StringKey* key) {m_key = key;}

	//C'tors and D'tors
	AvlNode(void);
	AvlNode(StringKey* keyP, Worker* dataP);
	virtual ~AvlNode(void);
};

#endif
